import request from '@/utils/request'

// 新增学期
export function addSchoolSemester(data) {
  return request({
    url: '/school/manager/schoolSemester',
    method: 'post',
    data: data
  })
}

// 修改学期
export function updateSchoolSemester(data) {
  return request({
    url: '/school/manager/schoolSemester',
    method: 'put',
    data: data
  })
}

// 删除学期
export function deleteSchoolSemester(id) {
  return request({
    url: '/school/manager/schoolSemester/' + id,
    method: 'delete'
  })
}

//学期列表
export function getSchoolSemesterList(query) {
  return request({
    url: '/school/manager/schoolSemester/list',
    method: 'get',
    params: query
  })
}

//获取本校/本院的班级列表
export function getClassList(query) {
  return request({
    url: '/school/manager/courseScheduling/getClassList',
    method: 'get',
    params: query
  })
}

//班级-学习成绩
export function getClassGrades(semesterId, classId) {
  return request({
    url: `/school/manager/Organization/class/grades/${semesterId}/${classId}`,
    method: 'get'
  })
}

//查询排课列表
export function getCourseSchedulingList(semesterId, params) {
  return request({
    url: `/school/manager/schoolSemester/${semesterId}`,
    method: 'get',
    params: params
  })
}

//修改排课
export function deleteCourseScheduling(id) {
  return request({
    url: '/school/manager/courseScheduling/' + id,
    method: 'delete'
  })
}
